package cn.wolfcode.service.impl;

import cn.wolfcode.domain.Customer;
import cn.wolfcode.domain.SysDictType;
import cn.wolfcode.mapper.CustomerMapper;
import cn.wolfcode.mapper.SysDictTypeMapper;
import cn.wolfcode.service.ICustomerService;
import cn.wolfcode.service.ISysDictTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by XuHangBin
 */
@Service
public class SysDictTypeServiceImpl implements ISysDictTypeService {

    @Autowired
    private SysDictTypeMapper sysDictTypeMapper;

    @Override
    public List<SysDictType> selectAll() {
        return sysDictTypeMapper.selectAll();
    }

    @Override
    public void saveOrUpdate(SysDictType sysDictType) {
        if(sysDictType.getDict_id()==null){
            sysDictTypeMapper.insert(sysDictType);
        }else{
            sysDictTypeMapper.update(sysDictType);
        }
    }

    @Override
    public SysDictType queryByType(String dict_type){
        return sysDictTypeMapper.queryByType(dict_type);

    }

    @Override
    public SysDictType getByDictType(String dict_type) {
        return sysDictTypeMapper.queryByType(dict_type);
    }

    @Override
    public SysDictType get(Long id) {
        return sysDictTypeMapper.get(id);
    }

}
